#!/bin/bash

echo "----------------------------------------"
# 检测文件（包括目录）是否存在
if [ -e "jarPID" ]; then
  jarPID=$(cat jarPID)
else
  jarPID="2"
fi

echo "---jarPID=$jarPID"

# 找到运行中的服务进程并停掉
if [ $jarPID != '2' ]; then
  echo "----------------------------------------"
  kill -9 $jarPID
  echo "kill PID:$jarPID success!"
  rm -rf jarPID
fi

echo "----------------------------------------"

